package com.baizhi.syh;


import com.baizhi.syh.VO.ResultVO;
import com.baizhi.syh.entity.Category;
import com.baizhi.syh.service.CategoryService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

//在测试类实例化同时去启动springboot应用  等价于new ClassPathXMLApplicationContext();
@RunWith(SpringRunner.class)
//指定应用启动时入口类的位置  等价于指定工厂配置文件
@SpringBootTest(classes = YingXueApplication.class)
public class test {

    @Autowired
    private CategoryService categoryService;

    @Test
    public void testSelectOneLevels(){
        ResultVO resultVO = categoryService.selectOneLevels(2, 5);
        for (Category row : resultVO.getRows()) {
            System.out.println(row);
        }
    }
}
